package com.shop.loan.proxy;

import com.shop.loan.qiniu.QiNiuUtil;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import xyz.erupt.annotation.fun.AttachmentProxy;

import javax.annotation.Resource;
import java.io.InputStream;

/**
 * 七牛对象存储demo
 *
 * @author yuepeng
 * @date 2020-05-17
 */
@Service
public class QiniuOosProxy implements AttachmentProxy {

    @Resource
    QiNiuUtil qiNiuUtil;

    @Value("${api.qiniu.fileDomainByQn}")
    private String fileDomain;

    @Override
    public String upLoad(InputStream inputStream, String path) {
        return qiNiuUtil.upLoad(inputStream,path);
    }

    @Override
    public String fileDomain() {
        return fileDomain;
    }
}
